<?php

namespace app\api\validate;

use app\common\validate\BaseValidate;
use think\Db;

class OrderValidate extends BaseValidate
{
    protected $rule = [
        'param' => 'require',
        'order_type' => 'require',
        'user_id' => 'require',
        'estimated_time' => 'require',
        'start_address' => 'require',
        'end_address' => 'require',
        'price' => 'require',
    ];

    protected $message = [
        'param.require' => '参数错误',
        'order_type.require' => '订单类型错误',
        'user_id.require' => '用户id错误',
        'estimated_time.require' => '请选择时间',
        'start_address.require' => '请选择出发地',
        'end_address.require' => '请选择目的地',
        'price.require' => '请选择价格',
    ];

    protected function sceneAdd()
    {
        $this->only(['order_type', 'estimated_time', 'start_address', 'end_address', 'price']);
    }

}